<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>Class: ActionController::Flash::FlashHash</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <meta http-equiv="Content-Script-Type" content="text/javascript" />
  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
  <script type="text/javascript">
  // <![CDATA[

  function popupCode( url ) {
    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
  }

  function toggleCode( id ) {
    if ( document.getElementById )
      elem = document.getElementById( id );
    else if ( document.all )
      elem = eval( "document.all." + id );
    else
      return false;

    elemStyle = elem.style;
    
    if ( elemStyle.display != "block" ) {
      elemStyle.display = "block"
    } else {
      elemStyle.display = "none"
    }

    return true;
  }
  
  // Make codeblocks hidden by default
  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
  
  // ]]>
  </script>

</head>
<body>



    <div id="classHeader">
        <table class="header-table">
        <tr class="top-aligned-row">
          <td><strong>Class</strong></td>
          <td class="class-name-in-header">ActionController::Flash::FlashHash</td>
        </tr>
        <tr class="top-aligned-row">
            <td><strong>In:</strong></td>
            <td>
                <a href="../../../files/vendor/rails/actionpack/lib/action_controller/flash_rb.html">
                vendor/rails/actionpack/lib/action_controller/flash.rb
                </a>
        <br />
            </td>
        </tr>

        <tr class="top-aligned-row">
            <td><strong>Parent:</strong></td>
            <td>
                Hash
            </td>
        </tr>
        </table>
    </div>
  <!-- banner header -->

  <div id="bodyContent">



  <div id="contextContent">



   </div>

    <div id="method-list">
      <h3 class="section-bar">Methods</h3>

      <div class="name-list">
      <a href="#M000289">discard</a>&nbsp;&nbsp;
      <a href="#M000288">keep</a>&nbsp;&nbsp;
      <a href="#M000287">now</a>&nbsp;&nbsp;
      </div>
    </div>

  </div>


    <!-- if includes -->

    <div id="section">



    <div id="aliases-list">
      <h3 class="section-bar">External Aliases</h3>

      <div class="name-list">
                        <table summary="aliases">
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">update</td>
          <td>-&gt;</td>
          <td class="context-item-value">merge!</td>
        </tr>
                        </table>
      </div>
    </div>


      


    <!-- if method_list -->
    <div id="methods">
      <h3 class="section-bar">Public Instance methods</h3>

      <div id="method-M000289" class="method-detail">
        <a name="M000289"></a>

        <div class="method-heading">
          <a href="#M000289" class="method-signature">
          <span class="method-name">discard</span><span class="method-args">(k = nil)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Marks the entire flash or a single flash entry to be discarded by the end
of the current action:
</p>
<pre>
    flash.discard              # discard the entire flash at the end of the current action
    flash.discard(:warning)    # discard only the &quot;warning&quot; entry at the end of the current action
</pre>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000289-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000289-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/flash.rb, line 102</span>
102:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">discard</span>(<span class="ruby-identifier">k</span> = <span class="ruby-keyword kw">nil</span>)
103:         <span class="ruby-identifier">use</span>(<span class="ruby-identifier">k</span>)
104:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000288" class="method-detail">
        <a name="M000288"></a>

        <div class="method-heading">
          <a href="#M000288" class="method-signature">
          <span class="method-name">keep</span><span class="method-args">(k = nil)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Keeps either the entire current flash or a specific flash entry available
for the next action:
</p>
<pre>
   flash.keep            # keeps the entire flash
   flash.keep(:notice)   # keeps only the &quot;notice&quot; entry, the rest of the flash is discarded
</pre>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000288-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000288-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/flash.rb, line 94</span>
94:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">keep</span>(<span class="ruby-identifier">k</span> = <span class="ruby-keyword kw">nil</span>)
95:         <span class="ruby-identifier">use</span>(<span class="ruby-identifier">k</span>, <span class="ruby-keyword kw">false</span>)
96:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000287" class="method-detail">
        <a name="M000287"></a>

        <div class="method-heading">
          <a href="#M000287" class="method-signature">
          <span class="method-name">now</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Sets a flash that will not be available to the next action, only to the
current.
</p>
<pre>
    flash.now[:message] = &quot;Hello current action&quot;
</pre>
<p>
This method enables you to use the flash as a central messaging system in
your app. When you need to pass an object to the next action, you use the
standard flash assign (<tt>[]=</tt>). When you need to pass an object to
the current action, you use <tt><a
href="FlashHash.html#M000287">now</a></tt>, and your object will vanish
when the current action is done.
</p>
<p>
Entries set via <tt><a href="FlashHash.html#M000287">now</a></tt> are
accessed the same way as standard entries:
<tt>flash[&#8216;my-key&#8217;]</tt>.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000287-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000287-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/flash.rb, line 86</span>
86:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">now</span>
87:         <span class="ruby-constant">FlashNow</span>.<span class="ruby-identifier">new</span>(<span class="ruby-keyword kw">self</span>)
88:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>


    </div>


  </div>


<div id="validator-badges">
  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>

</body>
</html>